%%%-------------------------------------------------------------------
%%% @author Rain
%%% @doc 角色进程监控者
%%% @end
%%%-------------------------------------------------------------------
-module(role_sup).

-behaviour(supervisor).

-export([start_link/0, init/1]).

start_link() ->
    supervisor:start_link({local, ?MODULE}, ?MODULE, []).

init([]) ->
    RoleServerChild = #{id => 'role_svr',
        start => {'role_svr', start_link, []},
        restart => permanent,
        shutdown => 2000,
        type => worker,
        modules => ['role_svr']},

    {ok, {#{strategy => simple_one_for_one,
        intensity => 5,
        period => 30}, [RoleServerChild]}
    }.
